import socket


class SocketClientClass:

    def __init__(self, server_address):
        self.server_address = server_address

    def connect(self):
        self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.socket.connect(self.server_address)

    def send(self, message):
        print(message)
        self.socket.sendall(message)

    def receive(self):
        response = self.socket.recv(1024)
        return response.decode()

    def close(self):
        self.socket.close()


if __name__ == "__main__":
    server_address = ('192.168.211.165', 8080)
    client = SocketClientClass(server_address)
    client.connect()
    message = b'Hello, server!'
    client.send(message)

    response = client.receive()
    print(response)

    client.close()